package com.example.dlmanager;

import java.util.Random;




public class UrlUtil
{
//外网 [START]
	public static final String urls[] = new String[]{ "miro891.com" , "ksw28.com" , "zwx67.com" , };
	
	public static final String getDataServerUrl()
	{
//		Log.i("tag", "http://" + "services." + urls[new Random().nextInt( urls.length )] /*+ "services"*/+ "/iloong/pui/ServicesEngineV1/DataService");
		return "http://" + "services." + urls[new Random().nextInt( urls.length )] /*+ "services"*/+ "/iloong/pui/ServicesEngineV1/DataService";
//		return "http://192.168.1.225/php/pui/admin.php?s=ServicesEngineV1/DataService";
	}
	
	public static final String getDownloadServerUrl()
	{
//		return "http://192.168.1.225/php/pui/admin.php?s=ServicesEngineV1/DataService";
		return "http://" + "download." + urls[new Random().nextInt( urls.length )] /*+ "download"*/+ "/iloong/pui/ServicesEngineV1/DataService";
	}
	
	public static final String getLogServerUrl()
	{
//		return "http://192.168.1.225/tjx/php/pui/admin.php?s=ServicesEngineV1/DataService";
		return "http://" + "record." + urls[new Random().nextInt( urls.length )] /*+ "record"*/+ "/iloong/pui/LogEngineV1/DataService";
	}
	//外网 [END]	
//内网[START]
//	public static final String urls[] = new String[]{ "192.168.1.222:85" , "192.168.1.222:86" , "192.168.1.222:87" , "192.168.1.222:88" };
//	
//	public static final String getDataServerUrl()
//	{
//		return "http://" + urls[new Random().nextInt( urls.length )] /*+ "services"*/+ "/iloong/pui/ServicesEngineV1/DataService";
//	}
//	
//	public static final String getDownloadServerUrl()
//	{
//		return "http://" + urls[new Random().nextInt( urls.length )] /*+ "download"*/+ "/iloong/pui/ServicesEngineV1/DataService";
//	}
//	
//	public static final String getLogServerUrl()
//	{
//		return "http://" + urls[new Random().nextInt( urls.length )] /*+ "record"*/+ "/iloong/pui/LogEngineV1/DataService";
//	}
	//内网[END]
	public static final String urlGetTime;// = "http://uifolder.coolauncher.com.cn/php/pui/date.php";
	public static final byte[] TimeArray = {
			-5 ,
			-21 ,
			66 ,
			-40 ,
			70 ,
			115 ,
			51 ,
			35 ,
			-119 ,
			-96 ,
			-53 ,
			29 ,
			-77 ,
			77 ,
			-80 ,
			3 ,
			-37 ,
			-121 ,
			44 ,
			93 ,
			12 ,
			-67 ,
			0 ,
			-73 ,
			-11 ,
			24 ,
			-128 ,
			-37 ,
			111 ,
			-6 ,
			13 ,
			-105 ,
			62 ,
			-75 ,
			-38 ,
			74 ,
			-24 ,
			-121 ,
			68 ,
			-102 ,
			96 ,
			74 ,
			-121 ,
			-14 ,
			-85 ,
			-128 ,
			52 ,
			-77 ,
			36 ,
			117 ,
			-86 ,
			-126 ,
			-81 ,
			-86 ,
			-44 ,
			-108 };
	static byte[] CientENCRYPT = new byte[]{ 107 , 54 , -31 , -117 , 79 , 70 , 110 , 64 , };
	static
	{
		urlGetTime = new String( DES.ecb_decode( CientENCRYPT , TimeArray ) );
	}
	
//	public static void test()
//	{
//		String str = "";
//		try
//		{
//			byte[] data = DES.ecb_encode( CientENCRYPT , urlGetTime.getBytes() );
//			data = DES.ecb_decode( CientENCRYPT , data );
//			str = new String( data );
//			data = DES.ecb_encode( CientENCRYPT , urls[0].getBytes() );
//			data = DES.ecb_decode( CientENCRYPT , data );
//			str = new String( data );
//			data = DES.ecb_encode( CientENCRYPT , urls[1].getBytes() );
//			data = DES.ecb_decode( CientENCRYPT , data );
//			str = new String( data );
//			data = DES.ecb_encode( CientENCRYPT , urls[2].getBytes() );
//			data = DES.ecb_decode( CientENCRYPT , data );
//			str = new String( data );
//		}
//		catch( Exception e )
//		{
//			// TODO Auto-generated catch block
//			e.printStackTrace();
//		}
//		if( str != null )
//			str = null;
//	}
}
